<template>
	<view>

		<custom title="商品返现" mode="2" fixed="fixed">

		</custom>

		<view style="padding: 30rpx 30rpx 0 30rpx;">
			<view class="br-20 bg-FFFFFF flex fs-28 flex-y-center hidden" style="position: relative;height: 132rpx;">

				<image style="width: 72rpx;height: 72rpx;border-radius: 50%;margin-left: 32rpx;position: relative;z-index: 2;"
					:src="user_info.avatarUrl" mode="aspectFill"></image>

				<view class="flex-1 fs-30 color-333333 bold ml-20 over-line1" style="position: relative;z-index: 2;">{{user_info.name}}</view>

				<view style="margin-right: 32rpx;position: relative;z-index: 2;" class="fs-28 color-999999">等级：{{user_info.agencyLevel || '无'}}</view>
				
				<view class="box-text-logo">FAGEXIN</view>
				
			</view>
		</view>




		<!-- 列表 -->
		<view style="padding: 0 30rpx;" v-if="list.length>0">
			<view style="padding: 10rpx 30rpx;border-radius: 16rpx;" class="bg-FFFFFF mt-30">

				<view class="back-item" v-for="(item,index) in list" :key="index">
					<view class="color-333333 fs-30">{{item.name}}</view>
					<view class="flex flex-y-center flex-x-b">
						<view class="color-999999 fs-26">时间：{{item.time}}</view>
						<view class="color-all fs-28 bold">金额：{{item.amt || '0'}}</view>
					</view>
					<view class="color-999999 fs-26">
						状态：<text
							:style="item.incomeStatus == 1?'':'color:#FD7747;'">{{item.incomeStatus == 1?'已发放':'待发放'}}</text>
					</view>
				</view>

			</view>
		</view>
		<!-- 列表 -->

		<qq-footer :show="is_null" :list="list"></qq-footer>



	</view>









	</view>
</template>

<script>
	export default {
		data() {
			return {
				tab_list: [{
						name: '全部',
						id: ''
					},
					{
						name: '待付款',
						id: 2
					},
					{
						name: '待收货',
						id: 3
					},
					{
						name: '已完成',
						id: 4
					},
					{
						name: '已取消',
						id: 1
					}
				],
				tab_index: 0,
				list: [],
				is_null: false,
				page: 1,
				myNum: '0',
				teamNum: '0',
				myNum2: "",
				teamNum2: "",
				background: 'rgba(255,255,255,0)',
				customBar: getApp().globalData.customBar + 'px',
				show_index: 20,
			};
		},
		onShow() {

		},
		onLoad(e) {

			this.init();


		},

		onReachBottom() {
			this.get_list(this.page);
		},
		onPullDownRefresh() {
			setTimeout(() => {
				uni.stopPullDownRefresh();
			}, 200);
			this.init();
		},


		methods: {

			init() {
				this.setData({
					page: 1,
					list: [],
					is_null: false,

				})
				this.get_list();
			},
			get_list(page = 1) {
				this.request({
					url: '/courseAccountDetails/getIncomeList',
					data: {
						pageNumber: page,
						pageSize: 20,
					},
					loading: page == 1,
				}).then(res => {

					if (res.status == 200) {
						let data = res?.data || [];
						data.forEach(v => {
							v.time = this.dateFormat('YYYY-mm-dd HH:MM:SS', new Date(v.overTime));
						});
						this.list = this.list.concat(data);


						if (data.length <= 20) {
							this.is_null = true;
						} else {}
						this.page++;
					}
				});
			},
			check_detail(id) {
				console.log('sss')
				this.request({
					url: '/wjuser/user/myUser',
					data: {
						id: id
					},
					loading: true,
				}).then(res => {
					if (res.status == 200) {
						console.log(res.data.myNum)
						if (res.data) {
							this.myNum2 = res.data.myNum;
							this.teamNum2 = res.data.teamNum;
							this.$refs.team.open();
						}
					}
				});
			},



		},

	}
</script>

<style lang="scss">
	page {
		background-color: $pageColor;

	}

	.back-item {
		padding: 30rpx 0;
	}

	.back-item+.back-item {
		border-top: 0.5px solid #E6E6E6;
	}
	
	.box-text-logo{
		
	}
	
	.box-text-logo{
		position: absolute;
		right: -10rpx;
		bottom: -20rpx;
		line-height: 1;
		color:#fff9f7;
		font-size: 100rpx;
		font-weight: bold;
		font-style: italic;
		letter-spacing: 10rpx;
	}
</style>